import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

public class Lab01 extends javax.swing.JFrame {

	public Lab01(String title) {

		super(title);
		this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);

		final JPanel p = new JPanel();
		p.setLayout(new FlowLayout());
		p.setBackground(java.awt.Color.WHITE);
		p.setSize(320, 480);
		final JButton b1 = new JButton("White");
		b1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				p.setBackground(java.awt.Color.white);
			}
		});
		b1.setSize(200, 75);
		final JButton b2 = new JButton("Black");
		b2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				p.setBackground(java.awt.Color.black);
			}
		});

		p.add(b1);
		p.add(b2);

		this.add(p);
		this.pack();
		this.setVisible(true);
	}

	public static void main(String[] args) {

		new Lab01("Lab 1");
	}
}